package com.lry.web.video.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.lry.web.video.entity.VideoUpdate;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface VideoUpdateMapper extends BaseMapper<VideoUpdate> {

    @Update("update video_update set deleted=0 where video_id = #{videoId} and deleted=1")
    int updateDeleted(@Param("videoId")String videoId);

    @Delete("delete from video_update where video_id = #{videoId}")
    int deleteByVideoId(@Param("videoId")String videoId);

    @Delete("delete from video_update where video_variable_id = #{vVId}")
    int deleteByVVId(@Param("vVId")String vVId);
    @Update("update video_update set deleted=1 where DATE_SUB(CURDATE(), INTERVAL 30 DAY) > date(update_time)")
    void updateTime30T();
}
